﻿@functions {
	private object ModelValue
	{
		get
		{
			if (ViewData.TemplateInfo.FormattedModelValue
				== ViewData.ModelMetadata.Model)
			{
				return string.Format(CultureInfo.CurrentCulture, "{0:N}", ViewData.ModelMetadata.Model);
			}

			return ViewData.TemplateInfo.FormattedModelValue;
		}
	}
}

@if (CultureInfo.CurrentCulture.NumberFormat.HasCurrencySymbol())
{
	if (CultureInfo.CurrentCulture.NumberFormat.IsSymbolBeforeNumber())
	{
		<div class="input-prepend">
			<span class="add-on">
				@CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol
			</span>
			<span class="input-small uneditable-input">@ModelValue</span>
		</div>
	}
	else
	{
		<div class="input-append">
			<span class="input-small uneditable-input">@ModelValue</span>
			<span class="add-on">
				@CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol
			</span>
		</div>
	}
}
else
{
	<span class="input-small uneditable-input">@ModelValue</span>
}